<?php
$xmlDoc = new DOMDocument();
$xmlDoc->load("test.xml");

$x = $xmlDoc->documentElement;
foreach ($x->childNodes AS $item) {
    echo $item->nodeName . ' = ' . $item->nodeValue . '<br>';
}

print '<br>' . $xmlDoc->saveXML();
?>